﻿namespace EasyCMS.Common
{
    using System;
    using System.Collections.Generic;
    using Pismire;


    /// <summary>
    /// 内容分类，全表缓冲
    /// </summary>
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName = "EasyCMS.Common.ICategorys")]
    public interface ICategorys
    {
        /// <summary>
        /// 根据ID获取分类数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ICategorys/GetByID", ReplyAction = "http://tempuri.org/ICategorys/GetByIDResponse")]
        EasyCMS.Common.DataComponents.Category GetByID(int id);

        /// <summary>
        /// 根据CodeName获取分类数据
        /// </summary>
        /// <param name="codeName"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ICategorys/GetByCodeName", ReplyAction = "http://tempuri.org/ICategorys/GetByCodeNameResponse")]
        EasyCMS.Common.DataComponents.Category GetByCodeName(string codeName);

        /// <summary>
        /// 查询数据集合
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Name = "GetList", Action = "http://tempuri.org/EasyCMS.Common.ICategorys/GetList", ReplyAction = "http://tempuri.org/ICategorys/GetListResponse")]
        List<EasyCMS.Common.DataComponents.Category> GetList(EasyCMS.Common.Querys.Category query);

        /// <summary>
        /// 查询数据集合
        /// </summary>
        /// <param name="query"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Name="GetListFull", Action = "http://tempuri.org/EasyCMS.Common.ICategorys/GetListFull", ReplyAction = "http://tempuri.org/ICategorys/GetListFullResponse")]
        List<EasyCMS.Common.DataComponents.Category> GetList(EasyCMS.Common.Querys.Category query, out int recordCount);

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ICategorys/Add", ReplyAction = "http://tempuri.org/ICategorys/AddResponse")]
        ExcuteState Add(ref EasyCMS.Common.DataComponents.Category category);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ICategorys/Update", ReplyAction = "http://tempuri.org/ICategorys/UpdateResponse")]
        ExcuteState Update(ref EasyCMS.Common.DataComponents.Category category);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.ICategorys/Delete", ReplyAction = "http://tempuri.org/ICategorys/DeleteResponse")]
        ExcuteState Delete(int id);
    }
}
